﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

  <CustomAction
  Id="PSProvisionerScriptGallery"
  GroupId="Galleries"
  Location="Microsoft.SharePoint.SiteSettings"
  Title="Provisioner scripts"
  Sequence="1000"
  RequireSiteAdministrator="TRUE"
    >
    <UrlAction Url="~sitecollection/_catalogs/provisionerscripts" />
  </CustomAction>

  
  <ListInstance Title="Provisioner Scripts"
                OnQuickLaunch="FALSE"
                TemplateType="10003"
                Url="_catalogs/provisionerscripts" Hidden="TRUE"
                Description="Provisioner Script Library">
    <Data>
      <Rows>
        <Row>
          <Field Name="Title">Sample Provisioner Script</Field>
          <Field Name="Templates">STS#0</Field>
          <Field Name="Script">
            <![CDATA[
<Provisioner>
  <FixupWebACL RespectInheritanceSetting="false" RoleAssignments="BreakClean" SyncGroupQuickLaunch="true">
    <SiteGroup Action="Create" Name="{{SPWeb.Title}} Owners" Description="Test for Office 365 - {{SPWeb.Description}}"
      AllowMembersEditMembership="true" AllowRequestToJoinLeave="true"
      AutoAcceptRequestToJoinLeave="true" OnlyAllowMembersViewMembership="false"
      RequestToJoinLeaveEmailSetting="administrator@wss-server.com"
      Owner="RENIT\admin" />
    <SiteGroup Action="Create" Name="{{SPWeb.Title}} Members"  />
    <SiteGroup Action="Create" Name="{{SPWeb.Title}} Visitors"  Description="365 Office" />
    <AssociateSiteGroup Name="{{SPWeb.Title}} Owners" Role="Owner" />
    <AssociateSiteGroup Name="{{SPWeb.Title}} Members" Role="Member" />
    <AssociateSiteGroup Name="{{SPWeb.Title}} Visitors" Role="Visitor" />
  </FixupWebACL>
  <FixupLists>
	 <List Title="Shared Documents">
		 <FixupACL RoleAssignments="BreakClean">
			 <PrincipalRole Action="Add" Name="{{SPWeb.Title}} Members" Type="SiteGroup" Role="Full Control" />
		 </FixupACL>
	 </List>
  </FixupLists>
  <ProvisionWebs>
    <!--The Template attribute should not be the same as the parent ('Provisioner Scripts' list) to avoid recursion-->
    <Web Title="Sub Web1" Description="Blah 1"  Template="STS#1" Url="subweb1" LCID="1033" UniquePermissions="true" InheritTopNav="true"  />
    <Web Title="Sub Web2" Description="Blah 2"  Template="STS#1" Url="subweb2" LCID="1033" UniquePermissions="true" InheritTopNav="true"  />
    <Web Title="Sub Web3" Description="Blah 3"  Template="STS#1" Url="subweb3" LCID="1033" UniquePermissions="true" InheritTopNav="true"  />
  </ProvisionWebs>
  <RestrictSiteTemplates>
    <Template LCID="1033">STS#0</Template>
    <Template>STS#1</Template>
  </RestrictSiteTemplates>
</Provisioner>
]]>
          </Field>
        </Row>
      </Rows>
    </Data>
  </ListInstance>


</Elements>
